<?php 
namespace Admin\Controller;;

/**
 * 商品控制器
 */
class GoodsController extends BaseController {
	/**
	 * 分页查询
	 */
	public function index() {
		//获取商品分类信息
		$m = D('Admin/GoodsCats');
		// $wd = $m->queryByList();
		// dump($wd);
		$this->assign('goodsCatsList',$m->queryByList());
		$m = D('Admin/Goods');
		$page = $m->queryByPage();
		// dump($page);
		$pager = new \Think\Page($page['total'],$page['pageSize']);// 实例化分页类 传入总记录数和每页显示的记录数
		$page['pager'] = $pager->show();
		// dump($page);
		$this->assign('Page',$page);
		$this->display("goods/list");
	}

	//查看
	public function toView() {
		$m = D('Admin/Goods');
		$object = $m->get();
		// dump($object);
		$this->assign('object',$object);
		$this->display('goods/view');
	}


}


?>